package com.hxkj.dao.impl;

import com.hxkj.dao.AuthRoleFunctionDao;
import com.hxkj.mapper.AuthRoleFunctionMapper;
import com.hxkj.domain.po.AuthRoleFunction;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.List;


/**
* 数据操作实现
*
* @author: chenwei
* @version: 1.0
* @datetime: 2018-05-21 17:59:26
*
*/
@Service("authRoleFunctionDao")
public class AuthRoleFunctionDaoImpl implements AuthRoleFunctionDao {

    @Resource
    private AuthRoleFunctionMapper authRoleFunctionMapper;

    @Override
    public AuthRoleFunction get(Long id) {
        return authRoleFunctionMapper.selectByPrimaryKey(id);
    }

    @Override
    public List<AuthRoleFunction> get(AuthRoleFunction authRoleFunction) {
        return authRoleFunctionMapper.select(authRoleFunction);
    }

    @Override
    public int delete(Long id) {
        return authRoleFunctionMapper.deleteByPrimaryKey(id);
    }

    @Override
    public int delete(AuthRoleFunction authRoleFunction) {
        return authRoleFunctionMapper.delete(authRoleFunction);
    }

    @Override
    public int deleteFunctionByRoleId(Long roleId) {
        return authRoleFunctionMapper.deleteFunctionByRoleId(roleId);
    }


    @Override
    public int save(AuthRoleFunction authRoleFunction) {
        return authRoleFunctionMapper.insert(authRoleFunction);
    }

    @Override
    public int update(AuthRoleFunction authRoleFunction) {
        return authRoleFunctionMapper.update(authRoleFunction);
    }
}
